Inserting Multiple OLEs

Hi Forum,

 

Its been very hectic to insert 100 OLEs and then paste table/image in that ole. So here what I thought. I need to insert Microsoft word doc OLEs after specific objects. (Like finding 'test' word and then replacing it by OLE)

For this I have two thoughts:

1st logic:

     1. Insert one blank OLE (MS word-Manually) & now using dxl copy that OLE. (may be program memory)

     2. Loop through the all object text and find the particular word say 'test'

     3. Now replace all the 'test' words by OLE copied in 1st step.

 and

2nd logic:

     1. Loop through the all object text and find the particular word say 'test'

     2. replace that word by calling Insert>OLE Object>Microsoft word document in DOORS.

I am not getting this in terms of code.

 

Please help..... Thank you in advance... :)

 

Thanks


Amol_S - Mon Nov 06 20:52:24 EST 2017

Re: Inserting Multiple OLEs
Amol_S - Mon Nov 06 21:26:53 EST 2017

I could develop this, which is copying only text part of selected object text, it is not copying the OLE inside that object text. My aim is to copy that blank OLE.

please suggest.

 

Object o = current
Module m = current

string strText = ""

string strReplacer = ""
strReplacer = o."Object Text" ""

int iContains = 0

Buffer buf = create()

for o in m do{
        strText = o."Object Text"
        buf = strText
        iContains = 0
       
        while (iContains != -1){
                strText = o."Object Text"
                buf = strText
                iContains = contains (buf, "test" , 0)
                if (iContains != -1){
                        strText = strText[0:iContains-1] "" strReplacer "" strText[iContains+4:] ""
                        o."Object Text" = strText ""
                }
        }
}